# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=8
PYTHON_COMPAT=( python3_{6..14} )
DISTUTILS_USE_PEP517=setuptools

inherit distutils-r1 git-r3

DESCRIPTION="Get mirrors"
HOMEPAGE="https://github.com/mirrorshq/mrget"
EGIT_REPO_URI="https://gitee.com/mirrorshq/mrget.git"

LICENSE="GPLv3"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
IUSE="+tools"

DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
        dev-python/atomicwrites[${PYTHON_USEDEP}]
        dev-python/htmllistparse[${PYTHON_USEDEP}]
        dev-python/sqlglot[${PYTHON_USEDEP}]
        tools? ( net-analyzer/netselect )"
RDEPEND=""

src_prepare() {
        eapply_user
        if ! use tools ; then
                sed -i '/scripts=\[/d' setup.py
        fi
}

src_install() {
        distutils-r1_src_install

        emake DESTDIR="${D}" install
}
